/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Usuario
 */
@Entity
@Table(name = "comprobante", catalog = "Sig", schema = "")
@NamedQueries({
    @NamedQuery(name = "Comprobante.findAll", query = "SELECT c FROM Comprobante c"),
    @NamedQuery(name = "Comprobante.findByIdComprobante", query = "SELECT c FROM Comprobante c WHERE c.idComprobante = :idComprobante"),
    @NamedQuery(name = "Comprobante.findByFecha", query = "SELECT c FROM Comprobante c WHERE c.fecha = :fecha"),
    @NamedQuery(name = "Comprobante.findByPagos", query = "SELECT c FROM Comprobante c WHERE c.pagos = :pagos"),
    @NamedQuery(name = "Comprobante.findByVouchers", query = "SELECT c FROM Comprobante c WHERE c.vouchers = :vouchers"),
    @NamedQuery(name = "Comprobante.findByMoneda", query = "SELECT c FROM Comprobante c WHERE c.moneda = :moneda"),
    @NamedQuery(name = "Comprobante.findByImporteTotal", query = "SELECT c FROM Comprobante c WHERE c.importeTotal = :importeTotal"),
    @NamedQuery(name = "Comprobante.findByRetencionIva", query = "SELECT c FROM Comprobante c WHERE c.retencionIva = :retencionIva"),
    @NamedQuery(name = "Comprobante.findByNetoCheque", query = "SELECT c FROM Comprobante c WHERE c.netoCheque = :netoCheque"),
    @NamedQuery(name = "Comprobante.findByFechaCobro", query = "SELECT c FROM Comprobante c WHERE c.fechaCobro = :fechaCobro"),
    @NamedQuery(name = "Comprobante.findByEstado", query = "SELECT c FROM Comprobante c WHERE c.estado = :estado")})
public class Comprobante implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idComprobante", nullable = false)
    private Integer idComprobante;
    @Basic(optional = false)
    @Column(name = "fecha", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Basic(optional = false)
    @Column(name = "pagos", nullable = false)
    private int pagos;
    @Basic(optional = false)
    @Column(name = "vouchers", nullable = false)
    private int vouchers;
    @Basic(optional = false)
    @Column(name = "moneda", nullable = false)
    private boolean moneda;
    @Basic(optional = false)
    @Column(name = "importeTotal", nullable = false)
    private double importeTotal;
    @Basic(optional = false)
    @Column(name = "retencionIva", nullable = false)
    private double retencionIva;
    @Basic(optional = false)
    @Column(name = "netoCheque", nullable = false)
    private double netoCheque;
    @Basic(optional = false)
    @Column(name = "fechaCobro", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fechaCobro;
    @Basic(optional = false)
    @Column(name = "estado", nullable = false, length = 45)
    private String estado;
    @OneToMany(mappedBy = "comprobante")
    private List<Contabilidad> contabilidadList;
    @JoinColumn(name = "idUsuario", referencedColumnName = "idUsuario", nullable = false)
    @ManyToOne(optional = false)
    private Usuario usuario;
    @JoinColumn(name = "idTarjeta", referencedColumnName = "idTarjeta", nullable = false)
    @ManyToOne(optional = false)
    private Tarjeta tarjeta;

    public Comprobante() {
    }

    public Comprobante(Integer idComprobante) {
        this.idComprobante = idComprobante;
    }

    public Comprobante(Integer idComprobante, Date fecha, int pagos, int vouchers, boolean moneda, double importeTotal, double retencionIva, double netoCheque, Date fechaCobro, String estado) {
        this.idComprobante = idComprobante;
        this.fecha = fecha;
        this.pagos = pagos;
        this.vouchers = vouchers;
        this.moneda = moneda;
        this.importeTotal = importeTotal;
        this.retencionIva = retencionIva;
        this.netoCheque = netoCheque;
        this.fechaCobro = fechaCobro;
        this.estado = estado;
    }

    public Integer getIdComprobante() {
        return idComprobante;
    }

    public void setIdComprobante(Integer idComprobante) {
        this.idComprobante = idComprobante;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public int getPagos() {
        return pagos;
    }

    public void setPagos(int pagos) {
        this.pagos = pagos;
    }

    public int getVouchers() {
        return vouchers;
    }

    public void setVouchers(int vouchers) {
        this.vouchers = vouchers;
    }

    public boolean getMoneda() {
        return moneda;
    }

    public void setMoneda(boolean moneda) {
        this.moneda = moneda;
    }

    public double getImporteTotal() {
        return importeTotal;
    }

    public void setImporteTotal(double importeTotal) {
        this.importeTotal = importeTotal;
    }

    public double getRetencionIva() {
        return retencionIva;
    }

    public void setRetencionIva(double retencionIva) {
        this.retencionIva = retencionIva;
    }

    public double getNetoCheque() {
        return netoCheque;
    }

    public void setNetoCheque(double netoCheque) {
        this.netoCheque = netoCheque;
    }

    public Date getFechaCobro() {
        return fechaCobro;
    }

    public void setFechaCobro(Date fechaCobro) {
        this.fechaCobro = fechaCobro;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public List<Contabilidad> getContabilidadList() {
        return contabilidadList;
    }

    public void setContabilidadList(List<Contabilidad> contabilidadList) {
        this.contabilidadList = contabilidadList;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public Tarjeta getTarjeta() {
        return tarjeta;
    }

    public void setTarjeta(Tarjeta tarjeta) {
        this.tarjeta = tarjeta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idComprobante != null ? idComprobante.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Comprobante)) {
            return false;
        }
        Comprobante other = (Comprobante) object;
        if ((this.idComprobante == null && other.idComprobante != null) || (this.idComprobante != null && !this.idComprobante.equals(other.idComprobante))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Comprobante[idComprobante=" + idComprobante + "]";
    }

}
